<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">

<ui:composition template="/WEB-INF/templates/template.xhtml">
	
	<ui:define name="conteudo">
	    <h:outputStylesheet name="Estoque.css" library="css"/> 
	 <h:outputScript name="evento.js" library="js"/>  
	     
       			<h:panelGrid columns="2" styleClass="user">
					<p:graphicImage url="/resources/users_2.ico" styleClass="icone" dir="rtl"/> <p class="logado">Usuario: #{usuarioBean.logado()}</p>
				</h:panelGrid>  
                <p:menubar>
                     <p:menuitem value="Adicionar Uni. limpeza" icon="ui-icon-plus"  url="/free/adiciona8900.xhtml" />
                     <p:menuitem value="Voltar" icon="ui-icon-arrowreturn-1-w" url="/free/inicio.xhtml" style="position: relative;left: 15px"/>
                     <p:menuitem value="Uni. limpeza nova" icon="ui-icon-document" url="/free/8900novo.xhtml" style="position: relative;left: 30px"/>
                     <p:menuitem value="Uni. limpeza em uso" icon="ui-icon-document" url="/free/8900emuso.xhtml" style="position: relative;left: 45px"/>
                     <p:menuitem value="Uni. limpeza usado" icon="ui-icon-trash" url="/free/8900usado.xhtml" style="position: relative;left: 60px"/>
                     <p:menuitem value="Logout" icon="ui-icon-extlink" url="Xerox/j_spring_security_logout" style="position: relative; left: 280px"/>
               </p:menubar>
       
            <h:form id="form">
                <h:panelGrid columns="2">
                	<p:graphicImage url="/resources/8900.jpg"/>
                	<p:panel id="pexport" header="Exportar" style="font-size:12px;text-align:center;" styleClass="pexport">
                	<h:commandLink>
                		<p:graphicImage id="export" styleClass="export" value="/resources/excel.png"/>
                		<p:dataExporter target="dataTable1" type="xls" fileName="Lista de Cera 8900" postProcessor="#{dataTableBean.postProcess}"/>
                	</h:commandLink>
                	</p:panel>
                </h:panelGrid>
                
                <p:growl id="msg"/>
                <br/><br/>
               
                <p:dataTable id="dataTable1" var="print" value="#{cq8900Bean.getListCera()}" styleClass="order-table" style="position: relative; left:22%;
                                                width: 60%" rowStyleClass="#{int eq 0 ?'dt1' :null} #{int eq 1 ?'dt2' :null} #{int eq 2 ?'dt3' :null} #{int eq 3 ?'dt4' :null}" rowIndexVar="int">
                                               
                        <f:facet name="header">
                                Lista de Cera
                        </f:facet>
                        
                        <!--<p:column headerText="ID" style="font-size:15px;">
                        	<h:outputText value="#{print.tId}"/> #{print.quantidade le 5 ?true :false}
                        </p:column>-->
                       
                        <p:column style="font-size:15px;">
                        		<f:facet name="header">
                        			<p:outputLabel value="MODELO"/>
                        		</f:facet>
                                <h:outputText value="#{print.modelo}" />
                        </p:column>
                       
                        <p:column style="font-size:15px;">
                        		<f:facet name="header">
                        			<p:outputLabel value="COR"/>
                        		</f:facet>
                                <h:outputText value="#{print.cor}" style="text-transform: uppercase"/>
                        </p:column>
                       
                        <p:column style="font-size:15px;">
                        		<f:facet name="header">
                        			<p:outputLabel value="QUANTIDADE"/>
                        		</f:facet>
                                <h:outputText value="#{print.quantidade}" style="text-transform: uppercase" id="quant"/>
                                
                        </p:column>
                        
                        <p:column headerText="AÇÕES" style="font-size:15px;" exportable="false">
                               
                                <p:commandButton icon="ui-icon-pencil" update=":form:edit" oncomplete="editWidget1.show()" title="editar">
                                	<f:setPropertyActionListener target="#{cq8900Bean.cera}" value="#{print}"/>
                                </p:commandButton>
                                
                        </p:column>
                       
                        <f:facet name="footer">
                                
                        </f:facet>
                </p:dataTable>
                
                <p:dialog header="Editar Cera" widgetVar="editWidget1"  resizable="false" modal="true" showEffect="explode" hideEffect="drop">
                	<p:ajax event="close" listener="#{cq8900Bean.limpar}"/>
                	<h:panelGrid id="edit" columns="2" cellpadding="4" style="margin:0 auto;">
                		
                				<p:outputLabel value="QUANTIDADE:" for="quantidade"/>
                                <p:inputText id="quantidade" style="text-transform: uppercase" value="#{cq8900Bean.cera.quantidade}"/>
                                
                                <p:commandButton value="Editar" icon="ui-icon-check" action="#{cq8900Bean.editar8900}" oncomplete="editWidget1.hide()"  update="dataTable1, msg"/>
                                <p:commandButton value="cancelar" icon="ui-icon-cancel" action="#{cq8900Bean.limpar}" oncomplete="editWidget1.hide()"/>
                	</h:panelGrid>
                </p:dialog>
                
                
            <br/>
            </h:form>
            <br/>
            <br/>
	</ui:define>
	
</ui:composition>
</html>